package demo.clone;

import java.io.Serializable;

public class Book implements Serializable {
    private String bookName;
    private int price;

    public Book(String bookName, int price) {
        this.bookName = bookName;
        this.price = price;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    @Override
    public String toString() {
        String txt = super.toString();
        if (txt != null && txt.length() >= 11) {
            return txt.substring(11) + " {" +
                    " bookName='" + bookName + '\'' +
                    ", price=" + price +
                    " }";
        } else {
            return "{" +
                    " bookName='" + bookName + '\'' +
                    ", price=" + price +
                    " }";
        }
    }
}
